#include "statusbar.h"

StatusBar::StatusBar(QWidget *parent) :
  QStatusBar(parent)
{
  simulatorStatus.setText(tr("No file opened"));
  simulatorStatus.setAlignment(Qt::AlignCenter);
  addWidget(&simulatorStatus, 1);

  eventListenerStatus.setText(tr("Not listening"));
  eventListenerStatus.setAlignment(Qt::AlignCenter);
  addWidget(&eventListenerStatus, 1);

  chatStatus.setText(tr("Unconnected"));
  chatStatus.setAlignment(Qt::AlignCenter);
  addWidget(&chatStatus, 1);

  setSizeGripEnabled(false);
}

void StatusBar::eventListenToIt(Shard s)
{
  eventListenerStatus.setText(tr("Listening: ") + "[" + s.regionShortName() + "] " + s.shardName());
}

void StatusBar::eventStopListening()
{
  eventListenerStatus.setText(tr("Not listening"));
}
